from metagpt.actions import Action
from metagpt.logs import logger
import subprocess
import re

TEAM_DESCRIPTION : str = """You are in a development team that is tasked with converting C/C++ code to Rust, taking into account Rust's unique features such as ownership, lifetimes, and concurrency. You aim to make the translated Rust code both aligned with C/C++ input and efficient to run. Specifically, the team is organized into the following roles: a C code commentator that adds line by line comment to the C code, a Rust translator that converts the C code to Rust, a main function adder to add main func to the Rust code, a Rust enhancer that improves the Rust code with rust features, a Rust runner that executes the Rust code, a compiler message analyzer that checks for errors, a test modifier that adjust the input and output format of testcases to match the translated Rust code to avoid any trivial test errors, and a Rust corrector that fixes any issues in the Rust code. The team members need to collaborate effectively to ensure a successful translation process."""


from c2rust.actions.comment_code import CommentCode
from c2rust.actions.translate_code import TranslateCode
from c2rust.actions.add_mainfn import AddMainFunc
from c2rust.actions.enhance_code import EnhanceCode, EnhanceCodeAfterCorrect
from c2rust.actions.correct_code import CorrectCode
from c2rust.actions.run_code import RunCode
from c2rust.actions.announce_result import AnnounceSuccess, AnnounceError, AnnounceEnd
from c2rust.actions.analyze_rust_feature import AnalyzeCode, AnalyzeCodeAfterCorrect
from c2rust.actions.retrieve_rust_tutorial import RetrieveTutorial, RetrieveTutorialAfterCorrect
from c2rust.actions.enhance_code_rag import EnhanceCodeAfterCorrectRAG, EnhanceCodeRAG
